package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName gkhomeworkorder
 */
@TableName(value ="gkhomeworkorder")
@Data
public class Gkhomeworkorder implements Serializable {
    /**
     * 订单id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 订单号
     */
    private String number;

    /**
     * 流水号与数据库不一致
     */

    //与数据库映射一样的不使用驼峰
    @TableField(value = "outTradeNo")
    private String outTradeNo;

    /**
     * 论文ID，对应gkpaper表的id
     */
    private Integer gkhomeworkid;

    /**
     * 购买人的用户id
     */
    private Integer userid;

    /**
     * 购买人的用户名字
     */
    private String username;

    /**
     * 购买人的内容
     */
    private String gkhomeworkname;

    /**
     * 订单价格
     */
    private Integer price;

    /**
     * 订单生成时间
     */
    private Date createtime;

    /**
     * 1微信支付2支付宝
     */
    private Integer type;

    /**
     * 订单状态
     */
    private String state;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Gkhomeworkorder other = (Gkhomeworkorder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
            && (this.getOutTradeNo() == null ? other.getOutTradeNo() == null : this.getOutTradeNo().equals(other.getOutTradeNo()))
            && (this.getGkhomeworkid() == null ? other.getGkhomeworkid() == null : this.getGkhomeworkid().equals(other.getGkhomeworkid()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getGkhomeworkname() == null ? other.getGkhomeworkname() == null : this.getGkhomeworkname().equals(other.getGkhomeworkname()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getOutTradeNo() == null) ? 0 : getOutTradeNo().hashCode());
        result = prime * result + ((getGkhomeworkid() == null) ? 0 : getGkhomeworkid().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getGkhomeworkname() == null) ? 0 : getGkhomeworkname().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", number=").append(number);
        sb.append(", outTradeNo=").append(outTradeNo);
        sb.append(", gkhomeworkid=").append(gkhomeworkid);
        sb.append(", userid=").append(userid);
        sb.append(", username=").append(username);
        sb.append(", gkhomeworkname=").append(gkhomeworkname);
        sb.append(", price=").append(price);
        sb.append(", createtime=").append(createtime);
        sb.append(", type=").append(type);
        sb.append(", state=").append(state);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}